apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: istiomulticlusters.deckhouse.io
  labels:
    heritage: deckhouse
    module: istio
spec:
  group: deckhouse.io
  scope: Cluster
  names:
    plural: istiomulticlusters
    singular: istiomulticluster
    kind: IstioMulticluster
  preserveUnknownFields: false
  versions:
    - name: v1alpha1
      served: true
      storage: true
      subresources:
        status: {}
      schema:
        openAPIV3Schema:
          type: object
          description: |
            Custom resource for setting remote cluster as trusted one.
          x-doc-d8Revision: ee
          required:
          - spec
          properties:
            spec:
              type: object
              x-doc-d8Revision: ee
              required:
              - metadataEndpoint
              properties:
                enableIngressGateway:
                  type: boolean
                  default: true
                  x-doc-d8Revision: ee
                  description: |
                    Should Istio use ingressgateways to access remote Pods?

                    If remote Pods are accessible directly from our cluster ("flat" network), it is efficient not to use extra hop.
                metadataEndpoint:
                  type: string
                  x-doc-d8Revision: ee
                  description: |
                    HTTPS endpoint with remote cluster metadata.
                  pattern: '^(https|file)://[0-9a-zA-Z._/-]+$'
                  x-doc-examples: ['https://istio.k8s.example.com/metadata/']
            status:
              type: object
              properties:
                metadataCache:
                  type: object
                  properties:
                    public:
                      type: object
                      properties:
                        rootCA:
                          type: string
                        authnKeyPub:
                          type: string
                        clusterUUID:
                          type: string
                    publicLastFetchTimestamp:
                      type: string
                      format: date-time
                    private:
                      type: object
                      properties:
                        apiHost:
                          type: string
                        networkName:
                          type: string
                        ingressGateways:
                          type: array
                          items:
                            type: object
                            properties:
                              address:
                                type: string
                              port:
                                type: integer
                    privateLastFetchTimestamp:
                      format: date-time
                      type: string
